package com.hiultra.archive.service.impl;

import com.hiultra.archive.domain.ArcEquipment;
import com.hiultra.archive.mapper.ArcEquipmentMapper;
import com.hiultra.archive.service.IArcEquipmentService;
import com.hiultra.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备管理Service业务层处理
 * 
 * @author ls
 * @date 2022-07-28
 */
@Service
public class ArcEquipmentServiceImpl implements IArcEquipmentService
{
    @Autowired
    private ArcEquipmentMapper arcEquipmentMapper;

    /**
     * 查询设备管理
     * 
     * @param equipmentId 设备管理主键
     * @return 设备管理
     */
    @Override
    public ArcEquipment selectArcEquipmentByEquipmentId(Long equipmentId)
    {
        return arcEquipmentMapper.selectArcEquipmentByEquipmentId(equipmentId);
    }

    /**
     * 查询设备管理列表
     * 
     * @param arcEquipment 设备管理
     * @return 设备管理
     */
    @Override
    public List<ArcEquipment> selectArcEquipmentList(ArcEquipment arcEquipment)
    {
        return arcEquipmentMapper.selectArcEquipmentList(arcEquipment);
    }

    /**
     * 新增设备管理
     * 
     * @param arcEquipment 设备管理
     * @return 结果
     */
    @Override
    public int insertArcEquipment(ArcEquipment arcEquipment)
    {
        arcEquipment.setCreateDate(DateUtils.getNowDate());
        return arcEquipmentMapper.insertArcEquipment(arcEquipment);
    }

    /**
     * 修改设备管理
     * 
     * @param arcEquipment 设备管理
     * @return 结果
     */
    @Override
    public int updateArcEquipment(ArcEquipment arcEquipment)
    {
        arcEquipment.setUpdateDate(DateUtils.getNowDate());
        return arcEquipmentMapper.updateArcEquipment(arcEquipment);
    }

    /**
     * 批量删除设备管理
     * 
     * @param equipmentIds 需要删除的设备管理主键
     * @return 结果
     */
    @Override
    public int deleteArcEquipmentByEquipmentIds(Long[] equipmentIds)
    {
        return arcEquipmentMapper.deleteArcEquipmentByEquipmentIds(equipmentIds);
    }

    /**
     * 删除设备管理信息
     * 
     * @param equipmentId 设备管理主键
     * @return 结果
     */
    @Override
    public int deleteArcEquipmentByEquipmentId(Long equipmentId)
    {
        return arcEquipmentMapper.deleteArcEquipmentByEquipmentId(equipmentId);
    }
}
